﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

/// <summary>
///AdminBase 的摘要说明
/// </summary>
public class AdminBase : System.Web.UI.MasterPage
{

    /// <summary>
    /// 页面初始化
    /// </summary>
    /// <param name="sender">对象</param>
    /// <param name="e">事件</param>
    protected void Page_Init(object sender, EventArgs e)
    {
        // Response.Write( "Page_Init "); 
        // 如果Session失效，返回到登陆页面
        // 修改记录：04
        AdminUser objAdminUser = AdminUser.GetCurrent();
        if (objAdminUser == null)
        {

            string url = Page.Request.Url.ToString();
            Server.Transfer("~/Admin/AdminLogin.aspx?From=" + HttpUtility.UrlEncode(url));
            //修改记录:03  修改日期: 2011-08-10 修改人: 刘丽利 活动号:612002196150  结束
            Response.End();
        }
        else
        {
            //string URL = HttpContext.Current.Request.Path.ToString();
            //if (URL.IndexOf("SY") > -1)
            //    return;
            //Navigation objNava = Navigation.GetByURL(URL);
            //if (objNava == null)
            //{
            //    DongDong.Common.MessageBox.ShowAndRedirect(this, "您没有权限进入", "/Admin/SY.aspx");
            //    return;
            //}
            //else
            //{

            //    if (!AdminNava.GetAllByAdminRoleID(objAdminUser.RoleID).Select(row => row.NavaID).Contains(objNava.ID))
            //    {
            //        DongDong.Common.MessageBox.ShowAndRedirect(this, "您没有权限进入", "/Admin/SY.aspx");
            //        return;
            //    }
            //}


        }
    }
}